import type { Directive, DirectiveBinding } from 'vue'
// import { useRoutesStore } from '@/store/modules/routes'
// import { BUTTON_PERMISSION_MAP } from '@/constants/button-permission'
 
const permission: Directive = {
  mounted(el: HTMLElement, binding: DirectiveBinding): void {
    const { value } = binding
 
    if (!value)
      return
    // const curValue = BUTTON_PERMISSION_MAP[binding.value]
    // const allBtnMap = useRoutesStore().buttonList
    // // 可根据自己的业务修改此处实现逻辑
    // if (!allBtnMap.includes(curValue))
    //   el.style.display = 'none'
    // else
    //   el.style.display = 'auto'
  },
}
 
export default permission